{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Quickstart\n",
        "\n",
        "In this quickstart, you will learn the basics of Daft's DataFrame and SQL API and the features that set it apart from frameworks like Pandas, PySpark, Dask, and Ray.\n",
        "\n",
        "<div class=\"admonition failure\">\n",
        "    <p class=\"admonition-title\">todo(docs): incorporate sql examples</p>\n",
        "</div>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Install Daft\n",
        "\n",
        "You can install Daft using `pip`. Run the following command in your terminal or notebook:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "pip install daft"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Create Your First Daft DataFrame\n",
        "\n",
        "Let's create a DataFrame from a dictionary of columns:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">A<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">B<br />Float64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">C<br />Boolean</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">D<br />Null</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1.5</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2.5</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">3</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">3.5</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">false</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">4</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">4.5</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">false</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 4 of 4 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 A     \u2506 B       \u2506 C       \u2506 D    \u2502\n",
              "\u2502 ---   \u2506 ---     \u2506 ---     \u2506 ---  \u2502\n",
              "\u2502 Int64 \u2506 Float64 \u2506 Boolean \u2506 Null \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 1     \u2506 1.5     \u2506 true    \u2506 None \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 2     \u2506 2.5     \u2506 true    \u2506 None \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 3     \u2506 3.5     \u2506 false   \u2506 None \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 4     \u2506 4.5     \u2506 false   \u2506 None \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 4 of 4 rows)"
            ]
          },
          "execution_count": 18,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "import daft\n",
        "\n",
        "df = daft.from_pydict(\n",
        "    {\n",
        "        \"A\": [1, 2, 3, 4],\n",
        "        \"B\": [1.5, 2.5, 3.5, 4.5],\n",
        "        \"C\": [True, True, False, False],\n",
        "        \"D\": [None, None, None, None],\n",
        "    }\n",
        ")\n",
        "\n",
        "df"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "You just created your first DataFrame!"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Read From a Data Source\n",
        "\n",
        "Daft supports both local paths as well as paths to object storage such as AWS S3:\n",
        "\n",
        "- CSV files: [`daft.read_csv(\"s3://path/to/bucket/*.csv\")`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/io_functions/daft.read_csv.html#daft.read_csv)\n",
        "- Parquet files: [`daft.read_parquet(\"/path/*.parquet\")`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/io_functions/daft.read_parquet.html#daft.read_parquet)\n",
        "- JSON line-delimited files: [`daft.read_json(\"/path/*.json\")`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/io_functions/daft.read_json.html#daft.read_json)\n",
        "- Files on disk: [`daft.from_glob_path(\"/path/*.jpeg\")`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/io_functions/daft.from_glob_path.html#daft.from_glob_path)\n",
        "\n",
        "<div class=\"admonition tip\">\n",
        "    <p class=\"admonition-title\">Note</p>\n",
        "    <p>\n",
        "        See <a href=https://www.getdaft.io/projects/docs/en/stable/user_guide/integrations.html>Integrations</a> to learn more about working with other formats like Delta Lake and Iceberg.\n",
        "    </p>\n",
        "</div>\n",
        "\n",
        "Let\u2019s read in a Parquet file from a public S3 bucket. Note that this Parquet file is partitioned on the column `country`. This will be important later on.\n",
        "\n",
        "<div class=\"admonition failure\">\n",
        "    <p class=\"admonition-title\">todo(docs): sql equivalent?</p>\n",
        "</div>"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">DoB<br />Date</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "</table>\n",
              "<small>(No data to display: Dataframe not materialized)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506 DoB  \u2506 country \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506 ---  \u2506 ---     \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 Date \u2506 Utf8    \u2506 Boolean \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(No data to display: Dataframe not materialized)"
            ]
          },
          "execution_count": 19,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# Set IO Configurations to use anonymous data access mode\n",
        "daft.set_planning_config(default_io_config=daft.io.IOConfig(s3=daft.io.S3Config(anonymous=True)))\n",
        "\n",
        "df = daft.read_parquet(\"s3://daft-public-data/tutorials/10-min/sample-data-dog-owners-partitioned.pq/**\")\n",
        "df"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Why does it say `(No data to display: Dataframe not materialized)` and where are the rows?\n",
        "\n",
        "## Execute Your DataFrame and View Data\n",
        "\n",
        "Daft DataFrames are **lazy** by default. This means that the contents will not be computed (\u201cmaterialized\u201d) unless you explicitly tell Daft to do so. This is best practice for working with larger-than-memory datasets and parallel/distributed architectures.\n",
        "\n",
        "The file we have just loaded only has 5 rows. You can materialize the whole DataFrame in memory easily using the [`df.collect()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.collect.html#daft.DataFrame.collect) method:\n",
        "\n",
        "<div class=\"admonition failure\">\n",
        "    <p class=\"admonition-title\">todo(docs): sql equivalent?</p>\n",
        "</div>\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 20,
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "                                                              \r"
          ]
        },
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">DoB<br />Date</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2001-02-12</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1967-01-02</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1984-04-07</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Evergreen</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">34</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1990-04-03</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Jale</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">62</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1962-03-24</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 5 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506 DoB        \u2506 country        \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506 ---        \u2506 ---            \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 Date       \u2506 Utf8           \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang   \u2506 Winter    \u2506 23    \u2506 2001-02-12 \u2506 Germany        \u2506 None    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra    \u2506 Shamas    \u2506 57    \u2506 1967-01-02 \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya       \u2506 Zaphora   \u2506 40    \u2506 1984-04-07 \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Ernesto    \u2506 Evergreen \u2506 34    \u2506 1990-04-03 \u2506 Canada         \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James      \u2506 Jale      \u2506 62    \u2506 1962-03-24 \u2506 Canada         \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 5 of 5 rows)"
            ]
          },
          "execution_count": 20,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "df.collect()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "To view just the first few rows, you can use the [`df.show()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.show.html#daft.DataFrame.show) method:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 21,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">DoB<br />Date</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2001-02-12</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1967-01-02</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1984-04-07</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 3 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506 DoB        \u2506 country        \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506 ---        \u2506 ---            \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 Date       \u2506 Utf8           \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang   \u2506 Winter    \u2506 23    \u2506 2001-02-12 \u2506 Germany        \u2506 None    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra    \u2506 Shamas    \u2506 57    \u2506 1967-01-02 \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya       \u2506 Zaphora   \u2506 40    \u2506 1984-04-07 \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 3 of 5 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.show(3)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Now let's take a look at some common DataFrame operations."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Selecting Columns\n",
        "\n",
        "You can **select** specific columns from your DataFrame with the [`df.select()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.select.html#daft.DataFrame.select) method.\n",
        "\n",
        "<div class=\"admonition failure\">\n",
        "    <p class=\"admonition-title\">todo(docs): sql equivalent?</p>\n",
        "</div>"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 22,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 5 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang   \u2506 None    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra    \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya       \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Ernesto    \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James      \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 5 of 5 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.select(\"first_name\", \"has_dog\").show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Selecting Rows\n",
        "\n",
        "You can **filter** rows using the [`df.where()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.where.html#daft.DataFrame.where) method that takes an Logical Expression predicate input. In this case, we call the [`df.col()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/expression_methods/daft.col.html#daft.col) method that refers to the column with the provided name `age`:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 23,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">DoB<br />Date</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1967-01-02</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1984-04-07</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Jale</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">62</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1962-03-24</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 3 of 3 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506 DoB        \u2506 country        \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506 ---        \u2506 ---            \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 Date       \u2506 Utf8           \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Shandra    \u2506 Shamas    \u2506 57    \u2506 1967-01-02 \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya       \u2506 Zaphora   \u2506 40    \u2506 1984-04-07 \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James      \u2506 Jale      \u2506 62    \u2506 1962-03-24 \u2506 Canada         \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 3 of 3 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.where(daft.col(\"age\") >= 40).show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Filtering can give you powerful optimization when you are working with partitioned files or tables. Daft will use the predicate to read only the necessary partitions, skipping any data that is not relevant.\n",
        "\n",
        "<div class=\"admonition tip\">\n",
        "    <p class=\"admonition-title\">Note</p>\n",
        "    <p>\n",
        "        As mentioned earlier that our Parquet file is partitioned on the <code>country</code> column, this means that queries with a <code>country</code> predicate will benefit from query optimization.\n",
        "    </p>\n",
        "</div>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Excluding Data\n",
        "\n",
        "You can **limit** the number of rows in a DataFrame by calling the [`df.limit()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.limit.html#daft.DataFrame.limit) method:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 24,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">DoB<br />Date</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2001-02-12</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 1 of 1 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506 DoB        \u2506 country \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506 ---        \u2506 ---     \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 Date       \u2506 Utf8    \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang   \u2506 Winter    \u2506 23    \u2506 2001-02-12 \u2506 Germany \u2506 None    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 1 of 1 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.limit(1).show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "To **drop** columns from the DataFrame, use the [`df.exclude()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.exclude.html#daft.DataFrame.exclude) method."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 25,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Evergreen</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">34</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Jale</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">62</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 5 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506 country        \u2506 has_dog \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506 ---            \u2506 ---     \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 Utf8           \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang   \u2506 Winter    \u2506 23    \u2506 Germany        \u2506 None    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra    \u2506 Shamas    \u2506 57    \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya       \u2506 Zaphora   \u2506 40    \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Ernesto    \u2506 Evergreen \u2506 34    \u2506 Canada         \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James      \u2506 Jale      \u2506 62    \u2506 Canada         \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 5 of 5 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.exclude(\"DoB\").show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Transforming Columns with Expressions\n",
        "\n",
        "[Expressions](core_concepts/expressions.md) are an API for defining computation that needs to happen over columns. For example, use the [`daft.col()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/expression_methods/daft.col.html#daft.col) expressions together with the [`with_column`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.with_column.html#daft.DataFrame.with_column) method to create a new column called `full_name`, joining the contents from the `last_name` column with the `first_name` column:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 26,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">full_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto Evergreen</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">34</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James Jale</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">62</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 5 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 full_name         \u2506 age   \u2506 country        \u2506 has_dog \u2502\n",
              "\u2502 ---               \u2506 ---   \u2506 ---            \u2506 ---     \u2502\n",
              "\u2502 Utf8              \u2506 Int64 \u2506 Utf8           \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang Winter   \u2506 23    \u2506 Germany        \u2506 None    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra Shamas    \u2506 57    \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya Zaphora      \u2506 40    \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Ernesto Evergreen \u2506 34    \u2506 Canada         \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James Jale        \u2506 62    \u2506 Canada         \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 5 of 5 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df = df.with_column(\"full_name\", daft.col(\"first_name\") + \" \" + daft.col(\"last_name\"))\n",
        "df.select(\"full_name\", \"age\", \"country\", \"has_dog\").show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Alternatively, you can also run your column transformation using Expressions directly inside your [`df.select()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.select.html#daft.DataFrame.select) method:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 27,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">full_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto Evergreen</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">34</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James Jale</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">62</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 5 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 full_name         \u2506 age   \u2506 country        \u2506 has_dog \u2502\n",
              "\u2502 ---               \u2506 ---   \u2506 ---            \u2506 ---     \u2502\n",
              "\u2502 Utf8              \u2506 Int64 \u2506 Utf8           \u2506 Boolean \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang Winter   \u2506 23    \u2506 Germany        \u2506 None    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra Shamas    \u2506 57    \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya Zaphora      \u2506 40    \u2506 United Kingdom \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Ernesto Evergreen \u2506 34    \u2506 Canada         \u2506 true    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James Jale        \u2506 62    \u2506 Canada         \u2506 true    \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 5 of 5 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.select((daft.col(\"first_name\").alias(\"full_name\") + \" \" + daft.col(\"last_name\")), \"age\", \"country\", \"has_dog\").show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Sorting Data\n",
        "\n",
        "You can **sort** a DataFrame with the [`df.sort()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.sort.html#daft.DataFrame.sort), in this example we chose to sort in ascending order:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 31,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">first_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">last_name<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">age<br />Int64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">DoB<br />Date</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />Boolean</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">full_name<br />Utf8</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Winter</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2001-02-12</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">None</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Wolfgang Winter</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Evergreen</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">34</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1990-04-03</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Ernesto Evergreen</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaphora</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">40</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1984-04-07</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Zaya Zaphora</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shamas</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">57</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1967-01-02</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Shandra Shamas</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Jale</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">62</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">1962-03-24</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">true</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">James Jale</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 5 of 5 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 first_name \u2506 last_name \u2506 age   \u2506      \u2026     \u2506 country        \u2506 has_dog \u2506 full_name         \u2502\n",
              "\u2502 ---        \u2506 ---       \u2506 ---   \u2506            \u2506 ---            \u2506 ---     \u2506 ---               \u2502\n",
              "\u2502 Utf8       \u2506 Utf8      \u2506 Int64 \u2506 (1 hidden) \u2506 Utf8           \u2506 Boolean \u2506 Utf8              \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Wolfgang   \u2506 Winter    \u2506 23    \u2506 \u2026          \u2506 Germany        \u2506 None    \u2506 Wolfgang Winter   \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Ernesto    \u2506 Evergreen \u2506 34    \u2506 \u2026          \u2506 Canada         \u2506 true    \u2506 Ernesto Evergreen \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Zaya       \u2506 Zaphora   \u2506 40    \u2506 \u2026          \u2506 United Kingdom \u2506 true    \u2506 Zaya Zaphora      \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Shandra    \u2506 Shamas    \u2506 57    \u2506 \u2026          \u2506 United Kingdom \u2506 true    \u2506 Shandra Shamas    \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 James      \u2506 Jale      \u2506 62    \u2506 \u2026          \u2506 Canada         \u2506 true    \u2506 James Jale        \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 5 of 5 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "df.sort(daft.col(\"age\"), desc=False).show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Grouping and Aggregating Data\n",
        "\n",
        "You can **group** and **aggregate** your data using the [`df.groupby()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.groupby.html#daft.DataFrame.groupby) and the [`df.agg()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.agg.html#daft.DataFrame.agg) methods. A groupby aggregation operation over a dataset happens in 2 steps:\n",
        "\n",
        "1. Split the data into groups based on some criteria using [`df.groupby()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.groupby.html#daft.DataFrame.groupby)\n",
        "2. Specify how to aggregate the data for each group using [`df.agg()`](https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/dataframe_methods/daft.DataFrame.agg.html#daft.DataFrame.agg)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 29,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<table class=\"dataframe\">\n",
              "<thead><tr><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">country<br />Utf8</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">avg_age<br />Float64</th><th style=\"text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left\">has_dog<br />UInt64</th></tr></thead>\n",
              "<tbody>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Canada</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">48</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">Germany</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">23</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">0</div></td></tr>\n",
              "<tr><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">United Kingdom</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">48.5</div></td><td><div style=\"text-align:left; max-width:192px; max-height:64px; overflow:auto\">2</div></td></tr>\n",
              "</tbody>\n",
              "</table>\n",
              "<small>(Showing first 3 of 3 rows)</small>\n",
              "</div>"
            ],
            "text/plain": [
              "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n",
              "\u2502 country        \u2506 avg_age \u2506 has_dog \u2502\n",
              "\u2502 ---            \u2506 ---     \u2506 ---     \u2502\n",
              "\u2502 Utf8           \u2506 Float64 \u2506 UInt64  \u2502\n",
              "\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n",
              "\u2502 Canada         \u2506 48      \u2506 2       \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 Germany        \u2506 23      \u2506 0       \u2502\n",
              "\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n",
              "\u2502 United Kingdom \u2506 48.5    \u2506 2       \u2502\n",
              "\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n",
              "\n",
              "(Showing first 3 of 3 rows)"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "grouped = df.groupby(\"country\").agg(daft.col(\"age\").mean().alias(\"avg_age\"), daft.col(\"has_dog\").count()).show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "<div class=\"admonition tip\">\n",
        "    <p class=\"admonition-title\">Note</p>\n",
        "    <p>\n",
        "    The <a href=\"https://www.getdaft.io/projects/docs/en/stable/api_docs/doc_gen/expression_methods/daft.Expression.alias.html#daft.Expression.alias\"><code>df.alias</code></a> method renames the given column.\n",
        "    </p>\n",
        "</div>"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "venv",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.13.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}
